#include <iostream>
using namespace std;

int main(){
	int n;
	cin >> n;
	int k;
	cin >> k;
	int f;
	cin >> f;
	int foot[1001] = {0};
	for(int i = 1; i <= f; i++){
		int temp;
		cin >> temp;
		int need;
		cin >> need;
		foot[temp] += need;
	}
	int result = 0;
	int remain = 0;
	for(int i = 1; i <= n; i++){
		int need = 1 + foot[i];
		if(remain < need){
			result ++;
			remain = k;
		}
		remain -= need;
	}
	cout << result << endl;
}
